<?php /* Smarty version 2.6.20, created on 2016-04-11 19:44:02
         compiled from ./purchases/index.php */ ?>
<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins(array('plugins' => array(array('block', 'rights', './purchases/index.php', 4, false),array('block', 'shops', './purchases/index.php', 10, false),array('block', 'purchases', './purchases/index.php', 42, false),array('modifier', 'default', './purchases/index.php', 15, false),array('modifier', 'date_format', './purchases/index.php', 15, false),array('function', 'url', './purchases/index.php', 87, false),)), $this); ?>
<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "admin/top.php", 'smarty_include_vars' => array('subject' => 'purchases')));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "purchases/top.php", 'smarty_include_vars' => array('subject' => 'purchases')));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
<div id="content">
<?php $this->_tag_stack[] = array('rights', array('right' => 'purchases_create')); $_block_repeat=true;smarty_block_rights($this->_tag_stack[count($this->_tag_stack)-1][1], null, $this, $_block_repeat);while ($_block_repeat) { ob_start(); ?><ul id="addmenu"><li style="display: inline;"><a href="<?php echo $this->_tpl_vars['site_admin']; ?>
m=inventory&s=purchases.php&uri=create">添加采购</a></li><li style="display: inline;padding-left:10px;"><a href="<?php echo $this->_tpl_vars['site_admin']; ?>
m=inventory&s=purchases.php&uri=orderProducts">待采购商品</a></li></ul><?php $_block_content = ob_get_contents(); ob_end_clean(); $_block_repeat=false;echo smarty_block_rights($this->_tag_stack[count($this->_tag_stack)-1][1], $_block_content, $this, $_block_repeat); }  array_pop($this->_tag_stack); ?>
    <div id="boxquery">
    <form method="get">
    <input type="hidden" name="m" value="inventory" />
        <input type="hidden" name="s" value="purchases.php" />
        <input type="submit" value="查询" class="fr" />
        <li>仓库:&nbsp; <select id="shopid" name="shopid"><option value="">全部</option><?php $this->_tag_stack[] = array('shops', array()); $_block_repeat=true;smarty_block_shops($this->_tag_stack[count($this->_tag_stack)-1][1], null, $this, $_block_repeat);while ($_block_repeat) { ob_start(); ?><option value="<?php echo $this->_tpl_vars['shops']['id']; ?>
" <?php if ($this->_tpl_vars['shops']['id'] == $_GET['shopid']): ?>selected<?php endif; ?>><?php echo $this->_tpl_vars['shops']['title']; ?>
</option><?php $_block_content = ob_get_contents(); ob_end_clean(); $_block_repeat=false;echo smarty_block_shops($this->_tag_stack[count($this->_tag_stack)-1][1], $_block_content, $this, $_block_repeat); }  array_pop($this->_tag_stack); ?></select></li>
        <li>采购单ID:&nbsp;<input type="text" name="paper_id" value="<?php echo $_GET['paper_id']; ?>
" /></li>
        <li>采购单名称:&nbsp;<input type="text" name="paper_title" value="<?php echo $_GET['paper_title']; ?>
" /></li>
        <li class="yui-skin-sam">添加时间:&nbsp; 
            <input id="sdate" name="sdate" type="text" size="12" value="<?php echo $_GET['sdate']; ?>
" onfocus="lockinput(this)" />
            <input id="edate" name="edate" type="text" size="12" value="<?php echo ((is_array($_tmp=((is_array($_tmp=@$_GET['edate'])) ? $this->_run_mod_handler('default', true, $_tmp, time()) : smarty_modifier_default($_tmp, time())))) ? $this->_run_mod_handler('date_format', true, $_tmp, '%Y-%m-%d') : smarty_modifier_date_format($_tmp, '%Y-%m-%d')); ?>
" onfocus="lockinput(this)" />
            <div id="calContainer" style="display:none; position:absolute;"></div>
        </li>
        <li>供应商:&nbsp;
        <input name="supplier" type="text" id="supplier" value="<?php echo $_GET['supplier']; ?>
" size="16" onclick="select()" oninput="context_menu_suppliers(this, 'supplierid=[id],supplier=[title]')" onfocus="context_menu_suppliers(this, 'supplierid=[id],supplier=[title]')" />
        </li>
        <li>状态:&nbsp; <select id="status" name="status"><option value="" >全部</option><option value="0" <?php if ('0' === $_GET['status']): ?>selected<?php endif; ?>>未入库</option><option value="1" <?php if ('1' === $_GET['status']): ?>selected<?php endif; ?>>已入库</option><option value="-1" <?php if ("-1" === $_GET['status']): ?>selected<?php endif; ?>>已删除</option></select></li>
    </form>
    </div>
    
    <table width="100%" border="0" cellspacing="0" cellpadding="0" id="lister">
      <tr id="title">
        <td width="40">ID</td>
        <td>名称</td>
        <td>仓库</td>
        <td>供应商</td>
        <td>备注</td>
        <td>运费</td>
        <td>折扣</td>
        <td>其他费用</td>
        <td>采购总价</td>
        <td>货币单位</td>
        <td>填单人</td>
        <td>填单时间</td>
        <td>状态</td>
        <td></td>
      </tr>
      <?php $this->_tag_stack[] = array('purchases', array('limit' => 20,'pager' => 'pager','page' => $this->_tpl_vars['segment']['page'],'order' => 'create_time desc','shopid' => $_GET['shopid'],'sdate' => $_GET['sdate'],'edate' => $_GET['edate'],'supplier' => $_GET['supplier'],'status' => $_GET['status'],'paper_id' => $_GET['paper_id'],'paper_title' => $_GET['paper_title'])); $_block_repeat=true;smarty_block_purchases($this->_tag_stack[count($this->_tag_stack)-1][1], null, $this, $_block_repeat);while ($_block_repeat) { ob_start(); ?>
      <tr id="content">
        <td><?php echo $this->_tpl_vars['purchases']['id']; ?>
</td>
        <td><?php echo $this->_tpl_vars['purchases']['title']; ?>
</td>
        <td><?php echo $this->_tpl_vars['purchases']['shop']; ?>
</td>
        <td><?php echo $this->_tpl_vars['purchases']['supplier_name']; ?>
</td>
        <td style="word-wrap:break-word; word-break:break-all;max-width:100px;"><?php echo $this->_tpl_vars['purchases']['memo']; ?>
</td>
        <td><?php echo $this->_tpl_vars['purchases']['express_price']*1; ?>
</td>
        <td><?php echo $this->_tpl_vars['purchases']['discount_price']*1; ?>
</td>
        <td><?php echo $this->_tpl_vars['purchases']['other_price']*1; ?>
</td>
        <td><?php echo $this->_tpl_vars['purchases']['purchase_price']*1; ?>
</td>
        <td><?php echo $this->_tpl_vars['purchases']['currency_unit']; ?>
</td>
        <td><?php echo $this->_tpl_vars['purchases']['puser']; ?>
</td>
        <td><?php echo $this->_tpl_vars['purchases']['create_time']; ?>
</td>
		<td>
			<?php if ($this->_tpl_vars['purchases']['status'] == '-1'): ?>已删除<?php endif; ?>
			<?php if ($this->_tpl_vars['purchases']['status'] == '0'): ?>未审核<?php endif; ?>
			<?php if ($this->_tpl_vars['purchases']['status'] == '1'): ?>已审核<?php endif; ?>
			<?php if ($this->_tpl_vars['purchases']['status'] == '2'): ?>已确认<?php endif; ?>
			<?php if ($this->_tpl_vars['purchases']['status'] == '9'): ?>已入库<?php endif; ?>
		</td>
        <td align="right">
        <?php if ($this->_tpl_vars['purchases']['status'] == '0'): ?>
        <a href="<?php echo $this->_tpl_vars['site_admin']; ?>
m=inventory&s=purchases.php&purchases_id=<?php echo $this->_tpl_vars['purchases']['id']; ?>
&uri=audit" onclick="return confirm('审核通过后将不能再删除, 确定?')">审核</a>
<!--         <?php $this->_tag_stack[] = array('rights', array('right' => 'purchases_remove')); $_block_repeat=true;smarty_block_rights($this->_tag_stack[count($this->_tag_stack)-1][1], null, $this, $_block_repeat);while ($_block_repeat) { ob_start(); ?><a href="<?php echo $this->_tpl_vars['site_admin']; ?>
m=inventory&s=purchases.php&purchases_id=<?php echo $this->_tpl_vars['purchases']['id']; ?>
&uri=remove" onclick="return confirm('删除数据不可恢复, 确定删除?')">删除</a><?php $_block_content = ob_get_contents(); ob_end_clean(); $_block_repeat=false;echo smarty_block_rights($this->_tag_stack[count($this->_tag_stack)-1][1], $_block_content, $this, $_block_repeat); }  array_pop($this->_tag_stack); ?> -->
        <?php $this->_tag_stack[] = array('rights', array('right' => 'purchases_modify')); $_block_repeat=true;smarty_block_rights($this->_tag_stack[count($this->_tag_stack)-1][1], null, $this, $_block_repeat);while ($_block_repeat) { ob_start(); ?><a href="<?php echo $this->_tpl_vars['site_admin']; ?>
m=inventory&s=purchases.php&purchases_id=<?php echo $this->_tpl_vars['purchases']['id']; ?>
&uri=modify">编辑</a><?php $_block_content = ob_get_contents(); ob_end_clean(); $_block_repeat=false;echo smarty_block_rights($this->_tag_stack[count($this->_tag_stack)-1][1], $_block_content, $this, $_block_repeat); }  array_pop($this->_tag_stack); ?>
        <?php endif; ?>
        <?php if ($this->_tpl_vars['purchases']['status'] == '1'): ?>
        <a href="<?php echo $this->_tpl_vars['site_admin']; ?>
m=inventory&s=purchases.php&purchases_id=<?php echo $this->_tpl_vars['purchases']['id']; ?>
&uri=confirm" onclick="return confirm('确认通过后将不能再编辑, 确定?')">确认</a>
<!--         <?php $this->_tag_stack[] = array('rights', array('right' => 'purchases_remove')); $_block_repeat=true;smarty_block_rights($this->_tag_stack[count($this->_tag_stack)-1][1], null, $this, $_block_repeat);while ($_block_repeat) { ob_start(); ?><a href="<?php echo $this->_tpl_vars['site_admin']; ?>
m=inventory&s=purchases.php&purchases_id=<?php echo $this->_tpl_vars['purchases']['id']; ?>
&uri=remove" onclick="return confirm('删除数据不可恢复, 确定删除?')">删除</a><?php $_block_content = ob_get_contents(); ob_end_clean(); $_block_repeat=false;echo smarty_block_rights($this->_tag_stack[count($this->_tag_stack)-1][1], $_block_content, $this, $_block_repeat); }  array_pop($this->_tag_stack); ?> -->
        <?php $this->_tag_stack[] = array('rights', array('right' => 'purchases_modify')); $_block_repeat=true;smarty_block_rights($this->_tag_stack[count($this->_tag_stack)-1][1], null, $this, $_block_repeat);while ($_block_repeat) { ob_start(); ?><a href="<?php echo $this->_tpl_vars['site_admin']; ?>
m=inventory&s=purchases.php&purchases_id=<?php echo $this->_tpl_vars['purchases']['id']; ?>
&uri=modify">编辑</a><?php $_block_content = ob_get_contents(); ob_end_clean(); $_block_repeat=false;echo smarty_block_rights($this->_tag_stack[count($this->_tag_stack)-1][1], $_block_content, $this, $_block_repeat); }  array_pop($this->_tag_stack); ?>
        <?php endif; ?>
        <a id="purchases_<?php echo $this->_tpl_vars['purchases']['id']; ?>
" href="javascript:void(0);" onclick="show_sku_list(<?php echo $this->_tpl_vars['purchases']['id']; ?>
);" act="show">查看</a>
        <a href="javascript:void(0);" onclick="javascript:window.parent.iframe_form('sendprint', '采购单打印', '/admin/module.php?m=logistics&s=print.php&type=purchasePrint&purchaseid=<?php echo $this->_tpl_vars['purchases']['id']; ?>
', 850,500);" act="show">打印</a>
        </td>
      </tr>
      <?php $_block_content = ob_get_contents(); ob_end_clean(); $_block_repeat=false;echo smarty_block_purchases($this->_tag_stack[count($this->_tag_stack)-1][1], $_block_content, $this, $_block_repeat); }  array_pop($this->_tag_stack); ?>
      <?php if ($this->_tpl_vars['pager']->rows == 0): ?>
      <tr id="content">
        <td colspan="20">&nbsp;</td>
      </tr>
      <?php endif; ?>
    </table>
    <div id="pager" class="mt10">
        <?php if ($this->_tpl_vars['pager']): ?>共<?php echo $this->_tpl_vars['pager']->rows; ?>
条记录 第<?php echo $this->_tpl_vars['pager']->pagecurrent; ?>
/<?php echo $this->_tpl_vars['pager']->pages; ?>
页 <?php endif; ?> 		
        <?php if ($this->_tpl_vars['pager']->current > 1): ?><a href="<?php echo smarty_function_url(array('s1' => 1), $this);?>
">首页</a><?php endif; ?>
        <?php if ($this->_tpl_vars['pager']->current > 1): ?><a href="<?php echo smarty_function_url(array('s1' => $this->_tpl_vars['pager']->current-1), $this);?>
">上页</a><?php endif; ?>
        <?php if ($this->_tpl_vars['pager']->current < $this->_tpl_vars['pager']->pages): ?><a href="<?php echo smarty_function_url(array('s1' => $this->_tpl_vars['pager']->current+1), $this);?>
">下页</a><?php endif; ?>
        <?php if ($this->_tpl_vars['pager']->current < $this->_tpl_vars['pager']->pages): ?><a href="<?php echo smarty_function_url(array('s1' => $this->_tpl_vars['pager']->pages), $this);?>
">尾页</a><?php endif; ?>
	</div>
</div>
<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "admin/bottom.php", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
</body>
</html>